package main

import "fmt"

func swap(p1, p2 *int) {
	*p1, *p2 = *p2, *p1
	//fmt.Printf("swap : a = %d,b = %d\n", a, b)
}

func main() {
	a, b := 10, 20
	//通过函数交换a 和 b 内容
	swap(&a, &b) //地址传递
	fmt.Printf("main : a = %d,b = %d\n", a, b)
}
